#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: fu
"""

import random
import pygame

def show_text(screen, pos, text, color, font_bold = False, font_size = 60, font_italic = False):   
    cur_font = pygame.font.SysFont("宋体", font_size)  
    cur_font.set_bold(font_bold)  
    cur_font.set_italic(font_italic)  
    text_fmt = cur_font.render(text, 1, color)  
    screen.blit(text_fmt, pos)
    
def modify_img(image):
    image = pygame.image.load(image)
    image = pygame.transform.smoothscale(image, (40, 40))
    image = pygame.transform.rotate(image, 0)
    
    return image

def random_color():
    colors = ['Blue', 'Green', 'Grey', 'Ice', 'Lapis Lazuli', 'Magma', \
              'Orange', 'Pink', 'Purple', 'Red', 'Turquoise', 'Yellow']
    return random.choice(colors)

def random_even(a, b):
    r = []
    if a % 2 == 0:
        for i in range(a, b, 2):
            r.append(i)
    else:
        for i in range(a + 1, b, 2):
            r.append(i)
    
    return random.choice(r)
